---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: macvlan1-config
spec: 
  config: '{
            "cniVersion": "{{ CNI_VERSION }}",
            "plugins": [
                {
                    "type": "macvlan",
                    "capabilities": { "ips": true },
                    "master": "eth1",
                    "mode": "bridge",
                    "ipam": {
                        "type": "static"
                    }
                }, {
                    "type": "tuning"
                } ]
        }'
---
apiVersion: v1
kind: Pod
metadata:
  name: macvlan1-worker1
  annotations:
    k8s.v1.cni.cncf.io/networks: '[
            { "name": "macvlan1-config",
              "ips": [ "10.1.1.11/24" ] }
    ]'
  labels:
    app: macvlan
spec:
  containers:
  - name: macvlan-worker1
    image: centos:8
    command: ["/bin/sleep", "10000"]
    securityContext:
      privileged: true
  nodeSelector:
    kubernetes.io/hostname: kind-worker
---
apiVersion: v1
kind: Pod
metadata:
  name: macvlan1-worker2
  annotations:
    k8s.v1.cni.cncf.io/networks: '[
            { "name": "macvlan1-config",
              "ips": [ "10.1.1.12/24" ] }
    ]'
  labels:
    app: macvlan
spec:
  containers:
  - name: macvlan-worker2
    image: centos:8
    command: ["/bin/sleep", "10000"]
    securityContext:
      privileged: true
  nodeSelector:
    kubernetes.io/hostname: kind-worker2
